package week06.personcmp;

import java.util.Random;

public class TestPersonCmp {
    public static void main(String[] args) {
        Person[] people=new Person[10];
        Random  random=new Random();
        for (int i=0;i<10;i++){
            people[i]=new Person(random.nextInt(100)+100);
        }
        for (int i=0;i<people.length;i++){
            System.out.println(i+1+" "+people[i].getHeight());
        }
        AbstractPersonCmp personCmb=new PersonCmpByHeight();
        personCmb.sort(people);
        System.out.println("排序后");
        for (int i=0;i<people.length;i++){
            System.out.println(i+1+" "+people[i].getHeight());
        }
    }
}
